This project explores how COVID-19 disrupted and reshaped public transport usage in New South Wales using data from the NSW Government.We focus on changes in overall travel trends, differences between transport modes, and signs of recovery in the post-pandemic period.The goal is to tell a clear, visual story about how travel patterns in NSW moved from a pre-COVID baseline and through lockdowns into the “new normal” of hybrid work.
First of all, let us have an overall view of the trends.
This chart shows the total number of public transport trips across all modes in NSW over time. We can clearly see the sharp drop in patronage during the main COVID-19 lockdown periods, followed by a gradual recovery as restrictions eased. This provides a baseline view of how strongly the pandemic disrupted everyday mobility in NSW.
Then we foucus the difference between the modes.
Using the first chart, we can observe the trends across different modes.For the two major modes - train and bus, both show a significant decline in 2020 which clearly showed the impact of the pandemic.To more clearly observe how the “popularity” of different transport modes has changed over time, we use two additional visualizations, a pie chart and a ranking chart.
We can see that although bus and train consistently make up the largest share from 2016 to 2025, their share has been gradually declining year by year. Now, we go deeper to see the difference of trips in the three periods for each mode.
Based on the two plots above, except for the light rail, generally the other four modes were all being impacted by the COVID in an average level. And for the light rail, it experienced a short-term impact, but over the course of the pandemic, its usage increased significantly compared to pre-pandemic levels.
These two charts show that although all transport modes have
recovered significantly compared to the pandemic period, bus and train
have still not returned to their pre-pandemic average levels. In
contrast, ferry, light rail, and metro have all surpassed their
pre-pandemic performance.
Based on the ranking chart, we can see that although the shares of bus and train are declining, their total trip volumes still remain the top two. Interestingly, light rail has been climbing in the rankings. Combined with the earlier trend chart, light rail was only affected during the initial phase of the pandemic; afterward, its total trips rose rapidly. Although there were fluctuations during COVID, its during-pandemic peaks exceeded the levels seen before the pandemic. It is true the climbing started before COVID, however it “seems” to less be impacted from the pademic. Therefore, we need to go deeper to the light rail data.
We can have an overall view of the light rail trips’ development.
Clearly, the trips of light rail keeps going up as time goes by.
From the three interactive visualisations above, we observe that although the overall trend for light rail is upward, the development of individual lines varies significantly.
For the Dulwich Hill Line, which used to be the dominant light rail line before the pandemic, its share has been steadily declining. Importantly, this decline began even before COVID-19, meaning the pandemic was only one contributing factor and a sharp short-term impact. Its share dropped from nearly 100% in 2016 to around 47% by 2020, just as the pandemic began. Although total trips have recovered since 2022, they have never returned to the levels seen between 2018 and 2020.
Its main “competitors” are now the Kingsford Line and the Randwick Line, both of which have grown substantially over the past nine years. The Kingsford Line is particularly interesting. It only started operating after the pandemic began (2020), yet it appears to have been minimally affected by COVID-19. It experienced only a brief dip between 2021 and 2022, and even during the early pandemic period (2020–2021), its trend was upward. Afterthe pandemic, its growth has been consistently strong.
In summary, the overall increase in light rail trips is largely driven by these two lines. And although the total number of light rail trips is still far below buses and trains as shown in earlier trend charts, it is still the mode that has experienced the largest proportional increase in popularity.
#read and clean
train <- read.csv("train.csv")
train_clean <- train %>%
mutate(
DATE_str = paste0("01-", Year_Month),
DATE = parse_date_time(DATE_str, orders = "d-b-y", locale = "C"),
DATE = as.Date(DATE),
Year = year(DATE),
Month = month(DATE, label = TRUE, abbr = TRUE),
Card_type = str_trim(Card_type),
Line = str_trim(Line)
) %>%
filter(!is.na(DATE)) %>%
arrange(DATE)
Now let us turn our view to the Trains data.
#Total train trips trend
train_total <- train_clean %>%
group_by(DATE,Line) %>%
summarise(
Trips_total = sum(Trip, na.rm = TRUE),
.groups = "drop"
)
#all lines together
train_total1 <- train_clean %>%
group_by(DATE) %>%
summarise(
Trips_total = sum(Trip, na.rm = TRUE),
.groups = "drop"
)
#whole trend regradless of line
ggplot(train_total1, aes(x = DATE, y = Trips_total)) +
geom_line() +
scale_y_continuous(labels = comma) +
labs(
x = "Year",
y = "Trips",
title = "Trips of Train per Year") +
theme(plot.title = element_text(hjust = 0.5,face = "bold"))
gg <- ggplot(train_total, aes(x = DATE, y = Trips_total, color = Line, group = Line)) +
geom_line_interactive(aes(tooltip = Line, data_id = Line)) +
scale_y_continuous(labels = comma) +
scale_color_viridis_d(guide = "none") +
labs(title = "Total Trips Per Lines",
x = "time",
y = "Trips") +
theme(plot.title = element_text(hjust = 0.5,face = "bold"))
x <- girafe(ggobj = gg, width_svg = 8, height_svg = 6,
options = list(
opts_hover_inv(css = "opacity:0.1;"),
opts_hover(css = "stroke-width:2;")
))
x
we can then see a pie chart
#we find there are tto mant lines so the plot is not friendly to view. we have to manually group the lines
#change data type
df_train_year <- train_total %>%
mutate(
DATE = as.Date(DATE)
) %>%
mutate(
Year = as.integer(format(DATE, "%Y"))
)
#now plot
d6 <- SharedData$new(df_train_year)
bscols(
widths = c(2, NA),
list(
filter_slider("year", "Year", d6, ~Year, width = "100%", step = 1, round = TRUE)
),
list(
plot_ly(d6,labels = ~Line, values = ~Trips_total, type = "pie", textinfo = "none") %>%
layout(
title = list(text = "Annual Train Share of Trips by Line", x = 0.35),
margin = list(t = 80),
height = 800,
width = 900
)
)
)
Warning: Specifying width/height in layout() is now deprecated.
Please specify in ggplotly() or plot_ly()
The time-series plot of total monthly bus trips shows two major COVID-related shocks in Sydney. The first and most severe drop begins around February 2020, reaching its lowest point in April 2020 during the peak of the initial lockdown. As restrictions eased, bus usage began to rise steadily throughout late 2020.
A second, smaller but still significant decline appears around July–August 2021, corresponding to the Delta outbreak and the second major lockdown in NSW. This second disruption interrupts the recovery that had begun after the first wave.
Following the 2021 lockdown, bus trips start increasing again, but the levels remain below the pre-pandemic period. The post-COVID pattern shows more variability and a flatter trajectory, indicating that although public transport demand improved, it never fully returned to the pre-2020 “normal.” Hybrid work, behavioural changes, and altered travel routines likely contribute to this long-term shift.
The bar chart summarises average bus usage across three major periods. The pre-COVID period has the highest average number of monthly trips, reflecting stable public transport demand before 2020. During COVID, the average drops sharply due to the lockdowns.
The post-COVID average increases compared with the pandemic period, consistent with the gradual recovery seen after late 2021. However, it still remains noticeably below the pre-COVID level.
The region comparison shows that Sydney Metro consistently has more people travelling compared to Outer Sydney. Sydney Metro also recovers more quickly after both COVID waves, with trips rising sooner and stabilising at a higher level. Outer Sydney follows the same pattern of decline and recovery but at a much smaller scale, showing lower usage overall.
In summary, the analysis shows that COVID-19 caused a dramatic and immediate drop in public transport usage across NSW, with the steepest decline occurring during the first lockdown in early 2020. Although patronage gradually recovered, a second decline during the 2021 outbreak highlighted how sensitive mobility patterns remained to public health restrictions. While bus, train and metro travel increased again after restrictions eased, overall usage has still not returned to pre-pandemic levels. In contrast, light rail usage continued to climb throughout the pandemic, making it the mode with the most notable change before and after COVID-19. In a sense, light rail has become a “new normal” compared to the pre-pandemic period.